﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace weixin.crm
{
    public class basepage : System.Web.UI.Page
    {
        //public static string Domain = "http://oa.448000.com";
        //public static string Domain = "http://localhost:5761";
        public static string Domain
        {
            get
            {
                if (HttpContext.Current.Request.Url.AbsoluteUri.StartsWith("http://localhost"))
                {
                    return "http://localhost:5761";
                }
                else
                {
                    return "http://oa.448000.com";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HttpCookie token = Request.Cookies.Get("token");
                if (token == null || string.IsNullOrEmpty(token.Value))
                {
                    Response.Redirect("login.aspx");
                }
            }
        }
    }
}